package internal

import (
	"github.com/name5566/leaf/gate"
)

func init() {
	skeleton.RegisterChanRPC("NewAgent", rpcNewAgent)
	skeleton.RegisterChanRPC("CloseAgent", rpcCloseAgent)

	skeleton.RegisterChanRPC("EnterRoom", rpcEnterRoom)

}

func rpcNewAgent(args []interface{}) {
	a := args[0].(gate.Agent)
	_ = a
}

func rpcCloseAgent(args []interface{}) {
	a := args[0].(gate.Agent)
	_ = a

}

func rpcEnterRoom(args []interface{}) {
	a := args[0].(gate.Agent)
	username := args[1].(string)

	// 登录成功
	PlayerManagerObj.AddPlayer(a, username)
}
